package com.jfinal.weixin.controller;

import com.jfinal.core.Controller;
import com.jfinal.weixin.model.Menu;
import com.jfinal.weixin.model.User;
import com.jfinal.weixin.model.WeixinInfo;
import com.jfinal.weixin.sdk.api.*;

/**
 * Created by chengzhichao on 16/5/4.
 */

public class UserController extends Controller {
    public ApiConfig getApiConfig() {
        ApiConfig ac = new ApiConfig(WeixinInfo.dao.getWeixinInfoById(1));
        return ac;
    }

    public void index(){
        ApiConfigKit.setThreadLocalApiConfig(this.getApiConfig());
        String apiResult = UserApi.getFollows().getJson();
        System.out.println(apiResult);
        setAttr("addNo", User.dao.gettodayadd());
        setAttr("removeNo",User.dao.gettodayremove());
        setAttr("countNo",User.dao.getcount());
        render("/_back/user/index.html");
    }



}
